import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import RoleManage from '@/components/main/moduleManage/RoleManage'
import UserManage from '@/components/main/moduleManage/UserManage'
import PackageInfo from '@/components/main/packageManage/PackageInfo'
import CustomerInfo from '@/components/main/customer/CustomerInfo'
import ScheduleManage from '@/components/main/customer/scheduleManage'
import GameAccountInfo from '@/components/main/gameAccountManage/GameAccountInfo'
import OrderList from '@/components/main/orderManage/OrderList'
import TradeHouse from '@/components/main/brickDots/TradeHouse'
import TradeHouseHistory from '@/components/main/brickDots/TradeHouseHistory'
import Home from '@/components/Home'
import Head from '@/components/main/base/Head'
import VueAMap from 'vue-amap';
import AccountDetail from "../components/main/customer/AccountDetail";


Vue.use(Router);

Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
  // 高德的key
  key: '426d22acd285aebb3f68c44efa97355f',
  // 插件集合
  plugin: ['Autocomplete', 'PlaceSearch', 'Scale', 'OverView', 'ToolBar', 'MapType', 'PolyEditor', 'CircleEditor'],
  // 高德 sdk 版本，默认为 1.4.4
  v: '1.4.4'
});

export default new Router({
  routes: [
    {
      path: '/',
      name: '登录',
      hidden: true,
      component: Login
    },
    {
      path: '/',
      name: '首页',
      hidden: true,
      component: Home,
      children: [
        {
          path: '/home',
          hidden: false,
          name: '首页',
          icon: 'el-icon-house',
          component: Head,
          meta: {
            keepAlive: true
          }
        }
      ]
    },
    // {
    //   path: '/',
    //   name: '首页',
    //   hidden: true,
    //   component: Main,
    //   children: [
    //     {
    //       path: '/home',
    //       hidden: true,
    //       name: '首页',
    //       icon: ' iconfont iconzhuye',
    //       component: Home,
    //       meta: {
    //         keepAlive: true
    //       }
    //     }
    //   ]
    // },
    {
      path: '/moduleManage',
      component: Home,
      hidden: true,
      name: '模块管理',
      icon: ' iconfont iconcaidanguanli',
      children: [
        {
          path: '/roleManage',
          hidden: true,
          name: '角色管理',
          icon: ' iconfont iconjiaoseguanli',
          component: RoleManage,
          meta: {
            keepAlive: true
          }
        },
        {
          path: '/userManage',
          hidden: true,
          name: '用户管理',
          icon: ' iconfont iconyonghuguanli_huaban',
          component: UserManage,
          meta: {
            keepAlive: true
          }
        }
      ]
    },
    {
      path: '/customerManage',
      component: Home,
      hidden: true,
      name: '代练管理',
      icon: ' iconfont iconkehuguanli',
      children: [
        {
          path: '/customerInfo',
          hidden: true,
          name: '代练信息',
          icon: ' iconfont iconkehuxinxiguanli',
          component: CustomerInfo,
          meta: {
            keepAlive: true
          }
        },
        {
          path: '/accountManage',
          hidden: true,
          name: '交易明细',
          icon: ' iconfont iconkehuxinxiguanli',
          component: AccountDetail,
          meta: {
            keepAlive: true
          }
        },
        {
          path: '/scheduleManage',
          hidden: true,
          name: '日程安排',
          icon: ' iconfont iconkehuxinxiguanli',
          component: ScheduleManage,
          meta: {
            keepAlive: true
          }
        },
      ]
    },
    {
      path: '/packageManage',
      component: Home,
      hidden: true,
      name: '套餐管理',
      icon: ' iconfont iconkehuguanli',
      children: [
        {
          path: '/packageInfo',
          hidden: true,
          name: '套餐信息',
          icon: ' iconfont iconkehuxinxiguanli',
          component: PackageInfo,
          meta: {
            keepAlive: true
          }
        },
      ]
    },
    {
      path: '/gameAccountManage',
      component: Home,
      hidden: true,
      name: '游戏管理',
      icon: ' iconfont iconkehuguanli',
      children: [
        {
          path: '/gameAccountInfo',
          hidden: true,
          name: '账号信息',
          icon: ' iconfont iconkehuxinxiguanli',
          component: GameAccountInfo,
          meta: {
            keepAlive: true
          }
        },
      ]
    },
    {
      path: '/orderManage',
      component: Home,
      hidden: true,
      name: '订单管理',
      icon: ' iconfont iconkehuguanli',
      children: [
        {
          path: '/orderList',
          hidden: true,
          name: '订单列表',
          icon: ' iconfont iconkehuxinxiguanli',
          component: OrderList,
          meta: {
            keepAlive: true
          }
        },
      ]
    },
    {
      path: '/brickDots',
      component: Home,
      hidden: true,
      name: '交易行',
      icon: ' iconfont iconkehuguanli',
      children: [
        {
          path: '/tradeHouse',
          hidden: true,
          name: '生活交易',
          icon: ' iconfont iconkehuxinxiguanli',
          component: TradeHouse,
          meta: {
            keepAlive: true
          }
        },
        {
          path: '/tradeHouseHistory',
          hidden: true,
          name: '生活交易存档',
          icon: ' iconfont iconkehuxinxiguanli',
          component: TradeHouseHistory,
          meta: {
            keepAlive: true
          }
        },
      ]
    },
  ]
})
